//app . son 两个组件

function Son(props) {
  const clickH = ()=>{
    props.msg('子组件数据')
  }
  return <div>这是子组件 <button onClick={clickH}>点击</button></div>
}

function App() {
  const msg = (type) => {
    console.log('111111111',type)
  }
  return (
    <div>
      <Son msg={msg} />
    </div>
  )
}

export default App
